package com.umakr.ax.security.service;

import com.umakr.ax.security.model.UserRole;
import com.umakr.ax.security.mapper.UserRoleMapper;
import com.umakr.ax.core.base.BaseService;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户_角色 服务实现类
 * </p>
 *
 * @author gx
 * @since 2017-04-25
 */
@Service
public class UserRoleService extends BaseService<UserRoleMapper, UserRole>{

    public List<UserRole> queryUserRoleByUserId(Long userId){
        Map<String,Object> map = Maps.newHashMap();
        map.put("user_id",userId);
        return selectByMap(map);
    }

    public void delByUserId(Long userId) {
        baseMapper.delByUserId(userId);
    }
}
